<?php
/**
 * Elgg add user form.
 *
 * @package Elgg
 * @subpackage Core
 */

$admin_option = false;
if ((get_loggedin_user()->isAdmin()) && ($vars['show_admin'])) {
	$admin_option = true;
}


$form_body = "<p><label>" . elgg_echo('new_register:producer') . "<br /><input type=\"checkbox\" name=\"producer\" value=\"true\" /></label><br />";
$form_body .= "<label>" . elgg_echo('name') . "<br />" . elgg_view('input/text' , array('internalname' => 'name', 'class' => "general-textarea", 'value' => $name)) . "</label><br />";
$form_body .= "<label>" . elgg_echo('email') . "<br />" . elgg_view('input/text' , array('internalname' => 'email', 'class' => "general-textarea", 'value' => $email)) . "</label><br />";
$form_body .= "<label>" . elgg_echo('username') . "<br />" . elgg_view('input/text' , array('internalname' => 'username', 'class' => "general-textarea", 'value' => $username)) . "</label><br />";
$form_body .= "<label>" . elgg_echo('password') . "<br />" . elgg_view('input/password' , array('internalname' => 'password', 'class' => "general-textarea")) . "</label><br />";
$form_body .= "<label>" . elgg_echo('passwordagain') . "<br />" . elgg_view('input/password' , array('internalname' => 'password2', 'class' => "general-textarea")) . "</label><br />";
$form_body .= "<label>" . elgg_echo('new_register:newsletter') . "<br /><input type=\"checkbox\" name=\"newsletter\" value=\"true\" /></label><br />";
//$form_body .= "<label>" . elgg_echo('new_register:producer') . "<br />" . elgg_view('input/checkboxes' , array('internalname' => 'producer', 'class' => "general-checkbox", 'value' => $producer)) . "</label><br />";
//$form_body .= "<label>" . elgg_echo('new_register:producer') . "<br />" . elgg_view('input/checkboxes' , array('internalname' => 'producer', 'class' => "general-checkbox", 'value' => $producer)) . "</label><br />";


if ($admin_option) {
	$form_body .= "<p>" . elgg_view('input/checkboxes', array('internalname' => "admin", 'options' => array(elgg_echo('admin_option'))));
}

$form_body .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('register'))) . "</p>";
?>


<div id="add-box">
<h2><?php echo elgg_echo('adduser'); ?></h2>
	<?php echo elgg_view('input/form', array('action' => "{$vars['url']}action/admin_add_user/new_useradd", 'body' => $form_body)) ?>
</div>